package com.myhexin.demo.ignite.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.myhexin.demo.ignite.mapper.PersonMapper;
import com.myhexin.demo.ignite.model.po.Person;
import com.myhexin.demo.ignite.service.PersonService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhangzhonglv@myhexin.com
 * @date 2025/8/24
 */
@Service
@RequiredArgsConstructor
public class PersonServiceImpl implements PersonService {

    private final PersonMapper personMapper;

    @Override
    public List<Person> queryAll() {
        return personMapper.selectList(null);
    }

    @Override
    public IPage<Person> queryPage(IPage<Person> page) {
        return personMapper.selectPage(page, null);
    }

    @Override
    public void add(Person person) {
        personMapper.insert(person);
    }
}
